using System;

using Pegasus.Workflow.Service;

namespace Pegasus.UnitTests.Workflow.Service.Workflows
{
	/// <summary>
	/// Test state that ends the workflow when the state is entered.
	/// </summary>
	public class StateStartAndEnd : WorkflowState
	{
		/// <summary>
		/// Initializes a new instance of the <see cref="T:StateStartAndEnd"/> class.
		/// </summary>
		public StateStartAndEnd() :
			base( "StateStartAndEnd" )
		{
		}

		/// <summary>
		/// Called when the state is entered.
		/// </summary>
		/// <param name="previousState">Previouse state, null if workflow is just starting.</param>
		protected override void OnStateEnter( string previousState )
		{
			base.OnStateEnter( previousState );
			Workflow.WorkflowComplete( 10 );
		}
	}
}
